/**
 * Created by xiaoxiao on 2019/7/22.
 */
$(document).ready(
    function() {
    	getUserInfo();
        // 八音分类
        var byJson = ajaxResult("get", false,"MbXtglBaseTableServlet.getPullData.do", {'tn' : 'mb_gy_byfl'});
        loadSelect("#class_bayin", byJson.rows, 'id', 'name');
        var columnsExpert = [
            {
                title : '锁定',
                checkbox : true,
                class : 'bs-checkbox',
                formatter : function(value, row, index) {
                    if (row.is_lock == '0') {
                        return {
                            // disabled : false,//设置是否可用
                            checked : false
                            // 设置未选中
                        };
                    } else {
                        return {
                            // disabled : false,//设置是否可用
                            checked : true
                            // 设置选中
                        };
                    }
                }
            },
            {title : '乐器名称',field : 'title'},
            {title : '自称',field : 'title_self'},
            {title : '音标',field : 'phoneticsymbol'	},
            {title : '名称解说词',field : 'titledescription'},
            {title : '霍萨分类',field : 'class_huosa_text'},
            {title : '八音分类',field : 'class_bayin_text'},
            {title : '民间分类',field : 'class_minjian_text'},
            {title : '出土地点',field : 'unearthedPlace'},
            {title : '年代',field : 'year_text'},
            {
                title : '操作',
                formatter : function(value, row, index) {
                    if (row.is_lock == '1') {
                        return '<a onclick="checkData(' + row.task_id + ')">审核</a>';
                    } else {
                        return '';
                    }

                }
            }
        ];
    	var params =$("#submitForm").serializeObject();		 
    	params["pageNumber"] = 1;
    	params["pageSize"] = pageSize;
    	params["offset"] = 0;
    	createTableWithLock('#data-table', '/cnmuseum/bm/bmlist', columnsExpert,params);
    });
function query() {
    refreshTable("#data-table", "#submitForm");
}
function checkData(task_id) {
    window.location.href = 'zyshDetail.html?task_id=' + task_id;
}
